#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<string.h>
int main()
{
	int arr1[] = { 12,45,24,87,34,56,12,5,6,7,8,23,56,90,14 };
	int sz = sizeof(arr1) / sizeof(arr1[0]);
	int i = 0, j = 0, k = 0, w = 0;
	int temp = 0, temp2 = 0;
	for (i = 0; i < sz; i++)
	{
		temp = arr1[i];
		for (j = i+1; j < sz; j++)
		{
			if (arr1[j] > arr1[i])
			{
				arr1[i] = arr1[j];
			}
			if (j == sz - 1)
			{
				for (k = i+1; k < sz; k++)
				{
					if (arr1[k] == arr1[i])
					{
						arr1[k] = temp;
						break;
					}
				}
			}
		}
	}
	for (w = 0; w < sz; w++)
	{
		printf("%d  ", arr1[w]);
	}
	return 0;
}